// You can use UUID this way to get always the same UUID for your input String: String aString="JUST_A_TEST_STRING"; String result = UUID.nameUUIDFromBytes(aString.getBytes()).toString();